import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import Mint from "mint-ui";
import global_ from "./global.config";
import echarts from 'echarts'

import "mint-ui/lib/style.css";
import "./assets/styles/reset.css";
import "./assets/styles/border.css";
import 'vue2-animate/dist/vue2-animate.min.css';

Vue.config.productionTip = false;
Vue.use(Mint);
Vue.prototype.global = global_;
Vue.prototype.$echarts = echarts;
// Vue.prototype.SDKRegister = that => {
//   // 接入微信JSSDK
//   // 获取微信JSSDK配置
//   let url = that.webUrl;
// };
const windowHeight = window.innerHeight
Vue.directive('fixedInput', function (el, binding) {
  el.addEventListener('blur', function () {
    let windowFocusHeight = window.innerHeight
    if (windowHeight == windowFocusHeight) {
      return
    }
    console.log(windowHeight + '--' + windowFocusHeight);
    console.log('修复');
    let currentPosition;
    let speed = 1; //页面滚动距离
    currentPosition = document.documentElement.scrollTop || document.body.scrollTop;
    currentPosition -= speed;
    window.scrollTo(0, currentPosition); //页面向上滚动
    currentPosition += speed; //speed变量
    window.scrollTo(0, currentPosition); //页面向下滚动
  })
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount("#app");
